<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>原型链</title>
</head>
<body>
<script>
    function Base(){
        this.a=2;
    }
    var o1=new Base();
    var o2=Object.create(Base);

    console.log(o2.a);//undefined
    console.log(o1.a);//2
    console.log(o2);
    console.log(o2.prototype);
    console.log(o1 instanceof Base);//true
    console.log(o2 instanceof Base);//false
    console.log(o1.constructor);
    console.log(o2.constructor);//
    //console.log(o1 instanceof Base);
    //Object.create()内部实现
//    Object.create=function(o){
//        var F=function(){ };
//        F.prototype=o;
//        return new F();
//    }

    //new 的时候发生了，
//    var o1=new Object();
//    o1.__proto__=Base.protoype;
//    Base.call(o1);


</script>
</body>
</html>